package com.itheima02;

public class Student3 {
    private String name;
    private int age;
    private String xingBie;

    public Student3() {
    }

    public Student3(String name, int age, String xingBie) {
        this.name = name;
        this.age = age;
        this.xingBie = xingBie;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getXingBie() {
        return xingBie;
    }

    public void setXingBie(String xingBie) {
        this.xingBie = xingBie;
    }

    @Override
    public String toString() {
        return "Student3{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", xingBie='" + xingBie + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student3 student3 = (Student3) o;

        if (age != student3.age) return false;
        if (name != null ? !name.equals(student3.name) : student3.name != null) return false;
        return xingBie != null ? xingBie.equals(student3.xingBie) : student3.xingBie == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + age;
        result = 31 * result + (xingBie != null ? xingBie.hashCode() : 0);
        return result;
    }
}
